package me.yuxiaoyao.lock.interceptor;

import org.springframework.lang.Nullable;

import java.lang.reflect.Method;
import java.util.Collection;

/**
 * @author kerryzhang on 2020/12/22
 */


public interface DistributedLockOperationSource {
    /**
     * is
     *
     * @param targetClass
     * @return
     */
    default boolean isCandidateClass(Class<?> targetClass) {
        return true;
    }

    /**
     * 获取方法上的注解
     *
     * @param method
     * @param targetClass
     * @return
     */

    @Nullable
    Collection<DistributedLockOperation> getLockOperations(Method method, @Nullable Class<?> targetClass);
}
